forked from arduino/Arduino
-
Notifications
You must be signed in to change notification settings - Fork 670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
msp430: i2c, allow choosing which USCI_Bx module to use #590
Open
alfh
wants to merge
13
commits into
energia:master
Choose a base branch
from
alfh:feature_i2c_prepare_more_than_one
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Replace #ifdef with #if defined, to consistently use if defined in the twi.c file. Likewise, replace ifndef with if !defined.
…SCB1 Replace hardcoded USCB0... registers with use of UCBx defines, so we can choose if we want to use USCB0 or USCB1.
The family guide suggests that pin mode should be set just before enabling the module.
Each MSP430 have just one type of module, USI, USCI, USCI_Bx, or EUSCI_Bx, so make code more readable by using #if #elif for the code that is different for the different modules.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Launchpad F5529 supports both USCI_B0 and USCI_B1 for i2c communcation.
This pull request adds support for choosing which module to use, by adding a "Wire.setModule(1)" before doing "Wire.begin()" in a sketch.
So this pull request allows one to choose which module to use, but it does not allow one to use both modules.
This is an attempt at making a simpler, i.e. less changes, pull request than pull request #398.
I think as a first step, it would be nice to at least choose which module to use.
Comments are appreciated.
Is there for example a better way to switch between registeres for USCI_B0 and USCI_B1 than using pointers ?
Note that this pull request also contains some i2c cleanup, which I've made separate pull requests for.
So I think the other pull requests should be merged first, and then I could rebase this pull request.
But I wanted to have the code as nice as possible in this pull request, so you can comment on what you like and dislike.
Regards
Alf Hogemark